GitHub 您所在的位置:网站首页 python aarch GitHub

GitHub

2024-03-19 07:57| 来源: 网络整理| 查看: 265

Clone the MediaPipe repo and follow the instruction to setup Bazel.

Install build dependencies.

$ sudo apt install -y python3-dev $ sudo apt install -y cmake

Install proto compiler.

$ sudo apt install -y protobuf-compiler

If you see a missing any.proto error later, which means the protoc might be too old, you can download the latest protoc-3.x.x-linux-aarch_64.zip from GitHub and copy the "bin" and "include/google" directories to the system libraries. Then, modify mediapipe/setup.py like the following:

diff --git a/setup.py b/setup.py index 61848de..462d91d 100644 --- a/setup.py +++ b/setup.py @@ -208,7 +208,7 @@ class GeneratePyProtos(setuptools.Command): sys.stderr.write('cannot find required file: %s\n' % source) sys.exit(-1) - protoc_command = [self._protoc, '-I.', '--python_out=.', source] + protoc_command = [self._protoc, '-I.', '-I/usr/local/include', '--python_out=.', source] if subprocess.call(protoc_command) != 0: sys.exit(-1)

Go to the MediaPipe directory.

~$ cd mediapipe

Remove unnecessary OpenCV modules and linker flags.

sed -i -e "/\"imgcodecs\"/d;/\"calib3d\"/d;/\"features2d\"/d;/\"highgui\"/d;/\"video\"/d;/\"videoio\"/d" third_party/BUILD sed -i -e "/-ljpeg/d;/-lpng/d;/-ltiff/d;/-lImath/d;/-lIlmImf/d;/-lHalf/d;/-lIex/d;/-lIlmThread/d;/-lrt/d;/-ldc1394/d;/-lavcodec/d;/-lavformat/d;/-lavutil/d;/-lswscale/d;/-lavresample/d" third_party/BUILD

Disable carotene_o4t in third_party/BUILD.

diff --git a/third_party/BUILD b/third_party/BUILD index ef408e4..51e1104 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -110,6 +104,8 @@ cmake_external( "WITH_ITT": "OFF", "WITH_JASPER": "OFF", "WITH_WEBP": "OFF", + "ENABLE_NEON": "OFF", + "WITH_TENGINE": "OFF",

Build the package.

~/mediapipe$ python3 setup.py gen_protos && python3 setup.py bdist_wheel


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有